export default function() {
	// #ifdef APP-PLUS
	return new Promise((resolve, reject) => {
		plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
			//console.log(plus.runtime.appid,plus.runtime.version,widgetInfo.version);
			//console.log(uni.getStorageSync('baseUrl'),uni.getSystemInfoSync().platform);
			uni.request({
			    url: uni.getStorageSync('baseUrl') + '/app/upgrade/check',
				method:"POST",
			    data: {
					platform:uni.getSystemInfoSync().platform,
					appId: plus.runtime.appid,
			       	appVersion: plus.runtime.version,
			       	wgtVersion: widgetInfo.version
			    },
			    header: {},
			    success: (res) => {
			        //console.log(res.data);
					resolve(res.data)	
			    }
			});
			
			// uniCloud.callFunction({
			// 	name: 'check-version',
			// 	data: {
			// 		appid: plus.runtime.appid,
			// 		appVersion: plus.runtime.version,
			// 		wgtVersion: widgetInfo.version
			// 	},
			// 	success: (e) => {
			// 		resolve(e)
			// 	},
			// 	fail: (error) => {
			// 		reject(error)
			// 	}
			// })
		})
	})
	// #endif
	// #ifndef APP-PLUS
	return new Promise((resolve, reject) => {
		reject({
			message: '请在App中使用'
		})
	})
	// #endif
}
